﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace lucere.entity
{
    public enum FieldSelectorResult
    {
        /// <summary>
        /// <para>
        /// Load this <see cref="IField"/> every time the <see cref="IDocument"/> is loaded,
        /// reading in the data as it is encountered. <see cref="IDocument.GetField"/>
        /// should not return null;
        /// </para>
        /// <see cref="IDocument.AddField"/> should be called by the Reader.
        /// </summary>
        Load,
        /// <summary>
        /// <para>
        /// Lazily load this <see cref="IField"/>.  This means the <see cref="IField"/> is valid,
        /// but it may not actually contain its data until invoked.  <see cref="IDocument.GetField"/>
        /// SHOULD NOT be used.  <see cref="IDocument.GetFieldable"/> is safe to use and should
        /// return a valid instance of a <see cref="IFieldable"/>
        /// </para>
        /// <see cref="IDocument.AddField"/> should be called by the Reader.
        /// </summary>
        LazyLoad,
        /// <summary>
        /// <para>
        /// Do not load the <see cref="IField"/>.  <see cref="IDocument.GetField"/> and 
        /// <see cref="IDocument.GetFieldable"/> should return null.  <see cref="IDocument.AddField"/>
        /// is not called.
        /// </para>
        /// <see cref="IDocument.AddField"/> should not be called by the Reader.
        /// </summary>
        NoLoad,
        /// <summary>
        /// <para>
        /// Load this field as in the <see cref="Load"/> case, but immediately return from 
        /// <see cref="IField"/> loading for the <see cref="IDocument"/>.  Thus, the Document 
        /// may not have its complete set of Fields.  <see cref="IDocument.GetField"/> and 
        /// <see cref="IDocument.GetFieldable"/> should both be valid for this <see cref="IField"/>
        /// </para>
        /// <see cref="IDocument.AddField"/> should be called by the Reader.
        /// </summary>
        LoadAndBreak,
        /// <summary>
        /// Expert:  Load the size of this <see cref="IField"/> rather than its value.  Size is measured as 
        /// number of bytes required to store the field == bytes for a binary or any compressed 
        /// value, and 2*chars for a String value. The size is stored as a binary value, 
        /// represented as an int in a byte[], with the higher order byte first in [0]
        /// </summary>
        Size,
        /// <summary>
        /// Expert: Like <see cref="Size"/> but immediately break from the field loading loop, i.e., stop loading further fields, after the size is loaded
        /// </summary>
        SizeAndBreak
    }
}
